# coding: utf-8
from sqlalchemy import Column, Integer, String
from sqlalchemy.ext.declarative import declarative_base


Base = declarative_base()
metadata = Base.metadata


class TbTieba(Base):
    __tablename__ = 'tb_tieba'

    name = Column(String(100, 'utf8_bin'), primary_key=True)
    type = Column(String(45, 'utf8_bin'))
    desc = Column(String(1000, 'utf8_bin'))
    img = Column(String(200, 'utf8_bin'))
    pnum = Column(Integer)


class TbTiebaUser(Base):
    __tablename__ = 'tb_tieba_user'

    username = Column(String(50, 'utf8_bin'), primary_key=True, nullable=False)
    tiebaname = Column(String(100, 'utf8_bin'), primary_key=True, nullable=False)
    level = Column(Integer)
    exp = Column(Integer)


class TbUser(Base):
    __tablename__ = 'tb_user'

    name = Column(String(50, 'utf8_bin'), primary_key=True)
    gender = Column(String(1, 'utf8_bin'))
    blood = Column(String(5, 'utf8_bin'))
    birthday = Column(String(20, 'utf8_bin'))
    birthplace = Column(String(45, 'utf8_bin'))
    locate = Column(String(45, 'utf8_bin'))
    desc = Column(String(1000, 'utf8_bin'))
    body = Column(String(10, 'utf8_bin'))
    marry = Column(String(5, 'utf8_bin'))
    hobby = Column(String(45, 'utf8_bin'))
    xingge = Column(String(100, 'utf8_bin'))
    edu = Column(String(10, 'utf8_bin'))
    work = Column(String(20, 'utf8_bin'))
    lxfs = Column(String(100, 'utf8_bin'))


class TbUserEducation(Base):
    __tablename__ = 'tb_user_education'

    id = Column(Integer, primary_key=True)
    name = Column(String(50, 'utf8_bin'))
    edutype = Column(String(10, 'utf8_bin'))
    eduname = Column(String(45, 'utf8_bin'))
    eduyear = Column(Integer)


class TbUserWork(Base):
    __tablename__ = 'tb_user_work'

    id = Column(Integer, primary_key=True)
    name = Column(String(50, 'utf8_bin'))
    company = Column(String(100))
    begin = Column(String(45, 'utf8_bin'))
    end = Column(String(45, 'utf8_bin'))
